package com.example.jiangzhu.mvpdemo.presenter;

import com.example.jiangzhu.mvpdemo.model.ILoginListener;
import com.example.jiangzhu.mvpdemo.model.IUserModel;
import com.example.jiangzhu.mvpdemo.model.UserModel;
import com.example.jiangzhu.mvpdemo.view.IUserView;

/**
 * Created by jiang zhu on 2018/4/5.
 */

public class IUserPresenter {

    private IUserView userView;
    //数据源


    private IUserModel userModel;
    //处理业务逻辑


    public IUserPresenter(IUserView userView){
        this.userView = userView;
        userModel = new UserModel();
    }



    /**
     * 登陆方法，进行M,V层的关系建立
     * @param loginListener
     */

    public void login(ILoginListener loginListener){
        userModel.login(userView.getUserName(),userView.getUserPsd(),loginListener);
    }

}
